package com.ljh.service.Impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ljh.mapper.SingerMapper;
import com.ljh.pojo.Singer;
import com.ljh.service.SingerService;
import com.ljh.vo.SexVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SingerServiceImpl extends ServiceImpl<SingerMapper,Singer> implements SingerService {

    @Autowired
    SingerMapper singerMapper;


    @Override
    public void deleteSingerById(Integer singerId) {
        singerMapper.deleteSingerById(singerId);
    }

    @Override
    public Singer findSingerById(Integer singerId) {
        return singerMapper.findSingerById(singerId);
    }

    @Override
    public Integer updateSingerById(Singer singer) {
        return singerMapper.updateSingerById(singer);
    }

    @Override
    public void UpdatePersonPhoto(String singerPhoto, Integer singerId) {
        singerMapper.UpdatePersonPhoto(singerPhoto, singerId);
    }

    @Override
    public void insertSinger(Singer singer) {
        singerMapper.insertSinger(singer);
    }

    @Override
    public List<Singer> findSingerByName(String singerName) {
        singerName = "%"+singerName+"%";
        return singerMapper.findSingerByName(singerName);
    }

    @Override
    public List<SexVo> findSingerSex() {
        return singerMapper.findSingerSex();
    }


}
